package com.example.p2p.adapter;

import android.view.View;
import android.widget.TextView;

import com.example.p2p.R;
import com.example.p2p.bean.Product;
import com.example.p2p.ui.RoundProgress;
import com.example.p2p.util.UIUtils;

import butterknife.Bind;

public class MyHolder extends BaseHolder<Product> {
    @Bind(R.id.p_name)
    TextView pName;
    @Bind(R.id.p_money)
    TextView pMoney;
    @Bind(R.id.p_yearlv)
    TextView pYearlv;
    @Bind(R.id.p_suodingdays)
    TextView pSuodingdays;
    @Bind(R.id.p_minzouzi)
    TextView pMinzouzi;
    @Bind(R.id.p_minnum)
    TextView pMinnum;
    @Bind(R.id.p_progresss)
    RoundProgress pProgresss;

    @Override
    protected View initView() {
        return View.inflate(UIUtils.getContext(), R.layout.item_product_list, null);
    }

    @Override
    protected void refreshData() {
        Product product = this.getData();

        pMinnum.setText(product.memberNum);
        pMinzouzi.setText(product.minTouMoney);
        pMoney.setText(product.money);
        pName.setText(product.name);
        pProgresss.setProgress(Integer.parseInt(product.progress));
        pSuodingdays.setText(product.suodingDays);
        pYearlv.setText(product.yearRate);
    }
}
